package com.ailanyin.modules.system.service.impl;

import com.ailanyin.modules.system.mapper.SysRegionMapper;
import com.ailanyin.modules.system.service.ISysRegionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author ailanyin
 * @version 1.0
 * @since 2022/3/7 0007 上午 9:28
 */
@Service
public class SysRegionServiceImpl implements ISysRegionService {

    @Resource
    private SysRegionMapper sysRegionMapper;

    @Override
    public List<Map<String, String>> getAllProvince() {
        return sysRegionMapper.getAllProvince();
    }

    @Override
    public List<Map<String, String>> getAllCityByProvinceCode(String provinceCode) {
        return sysRegionMapper.getAllCityByProvinceCode(provinceCode);
    }

    @Override
    public List<Map<String, String>> getAllAreaByCityCode(String cityCode) {
        return sysRegionMapper.getAllAreaByCityCode(cityCode);
    }

    @Override
    public List<Map<String, String>> getAllStreetByAreaCode(String areaCode) {
        return sysRegionMapper.getAllStreetByAreaCode(areaCode);
    }

    @Override
    public String getProvinceName(String code) {
        return sysRegionMapper.getProvinceName(code);
    }

    @Override
    public String getCityName(String code) {
        return sysRegionMapper.getCityName(code);
    }

    @Override
    public Map<String, Object> getIdsByNames(String provinceName, String cityName, String areaName) {
        return sysRegionMapper.getIdsByNames(provinceName, cityName, areaName);
    }
}
